/*
 * AzioneLogOut.java
 *
 * Created on 21 agosto 2006, 16.26
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package it.azienda.framework.controllo;

import it.azienda.framework.utilita.Utilita;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;

public class AzioneLogOut {
    
    /** Creates a new instance of AzioneLogOut */
    public AzioneLogOut() {
    }
    
    public void esegui() {
        Utilita.getSession().invalidate();
        String url = "/home.jsf";
        FacesContext ctx = FacesContext.getCurrentInstance();
        UIViewRoot view = ctx.getApplication().getViewHandler().createView(ctx,url);
        view.setViewId(url);
        ctx.setViewRoot(view);
        ctx.renderResponse();        
    }
    
}
